<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!-- Copyright 1997 The Open Group, All Rights Reserved -->
<title>expand</title>
</head><body bgcolor=white>
<center>
<font size=2>
The Single UNIX &reg; Specification, Version 2<br>
Copyright &copy; 1997 The Open Group

</font></center><hr size=2 noshade>
<h4><a name = "tag_001_014_605">&nbsp;</a>NAME</h4><blockquote>
expand - convert tabs to spaces
</blockquote><h4><a name = "tag_001_014_606">&nbsp;</a>SYNOPSIS</h4><blockquote>
<pre><code>

expand <b>[</b>-t <i>tablist</i><b>][</b><i>file</i> ...<b>]</b>

expand <b>[</b>-<i>tabstop</i><b>][</b>-<i>tab1</i>,<i>tab2</i>,...,<i>tabn</i><b>][</b><i>file</i>...<b>]</b>
</code>
</pre>
</blockquote><h4><a name = "tag_001_014_607">&nbsp;</a>DESCRIPTION</h4><blockquote>
The
<i>expand</i>
utility writes files or the standard input to the
standard output with
tab
characters replaced with
one or more
space
characters needed to pad to the next tab stop.
Any
backspace
characters will be copied to the output and
cause the column position
count for tab stop calculations to be decremented;
the column position count will not be decremented below zero.
</blockquote><h4><a name = "tag_001_014_608">&nbsp;</a>OPTIONS</h4><blockquote>
The
<i>expand</i>
utility supports the <b>XBD</b> specification, <a href="../xbd/utilconv.html#usg"><b>Utility Syntax Guidelines</b>&nbsp;</a> ;
the obsolescent version does not.
<p>
The following options are supported:
<dl compact>

<dt><b>-t&nbsp;</b><i>tablist</i>
<dd>
Specify the tab stops.
The argument
<i>tablist</i>
must consist of a single positive decimal integer or multiple
positive decimal integers,
separated by
blank characters
or commas, in ascending order.
If a single number is given, tabs will be set
<i>tablist</i>
column positions apart instead of the default 8.
If multiple numbers are given,
the tabs will be set at those
specific column positions.

Each tab-stop position
<i>N</i>
must be an integer value greater than zero,
and the list must be in strictly ascending order.
This is taken to mean that, from the start of a line of
output, tabbing to position
<i>N</i>
causes the next character output to
be in the
(<i>N</i>+1)th
column position on that line.

In the event of
<i>expand</i>
having to process a
tab
character at a position
beyond the last of those specified in a multiple tab-stop list, the
tab character
is replaced by a single
space character
in the output.

</dl>
<p>
In the obsolescent version, the single number is specified as
<i>tabstop</i>
with a leading minus;
multiple tab stops are specified after a leading minus as
<i>tab1</i>,
<i>tab2</i>
and so on.
</blockquote><h4><a name = "tag_001_014_609">&nbsp;</a>OPERANDS</h4><blockquote>
The following operand is supported:
<dl compact>

<dt><i>file</i><dd>The pathname of a text file to be used as input.

</dl>
</blockquote><h4><a name = "tag_001_014_610">&nbsp;</a>STDIN</h4><blockquote>
See the INPUT FILES section.
</blockquote><h4><a name = "tag_001_014_611">&nbsp;</a>INPUT FILES</h4><blockquote>
Input files must be text files.
</blockquote><h4><a name = "tag_001_014_612">&nbsp;</a>ENVIRONMENT VARIABLES</h4><blockquote>
The following environment variables affect the execution of
<i>expand</i>:
<dl compact>

<dt><i>LANG</i><dd>Provide a default value for the internationalisation variables
that are unset or null.
If
<i>LANG</i>
is unset or null, the corresponding value from the
implementation-dependent default locale will be used.
If any of the internationalisation variables contains an invalid setting, the
utility will behave as if none of the variables had been defined.


<dt><i>LC_ALL</i><dd>
If set to a non-empty string value,
override the values of all the other internationalisation variables.

<dt><i>LC_CTYPE</i><dd>
Determine the
locale for the interpretation of sequences of bytes of text data as
characters (for example, single- as opposed to multi-byte characters
in arguments and input files),
the processing of
tab
and
space characters,
and for the determination of the width in column positions
each character would occupy on a constant-width font output device.

<dt><i>LC_MESSAGES</i><dd>
Determine the locale that should be used to affect
the format and contents of diagnostic
messages written to standard error.

<dt><i>NLSPATH</i><dd>
Determine the location of message catalogues
for the processing of
<i>LC_MESSAGES .
</i>
</dl>
</blockquote><h4><a name = "tag_001_014_613">&nbsp;</a>ASYNCHRONOUS EVENTS</h4><blockquote>
Default.
</blockquote><h4><a name = "tag_001_014_614">&nbsp;</a>STDOUT</h4><blockquote>
The standard output is equivalent to the input files with
tab
characters converted into the appropriate number of
space characters.
</blockquote><h4><a name = "tag_001_014_615">&nbsp;</a>STDERR</h4><blockquote>
Used only for diagnostic messages.
</blockquote><h4><a name = "tag_001_014_616">&nbsp;</a>OUTPUT FILES</h4><blockquote>
None.
</blockquote><h4><a name = "tag_001_014_617">&nbsp;</a>EXTENDED DESCRIPTION</h4><blockquote>
None.
</blockquote><h4><a name = "tag_001_014_618">&nbsp;</a>EXIT STATUS</h4><blockquote>
The following exit values are returned:
<dl compact>

<dt>0<dd>Successful completion

<dt>&gt;0<dd>An error occurred.

</dl>
</blockquote><h4><a name = "tag_001_014_619">&nbsp;</a>CONSEQUENCES OF ERRORS</h4><blockquote>
The
<i>expand</i>
utility will terminate with an error message
and non-zero exit status upon encountering
difficulties accessing one of the
<i>file</i>
operands.
</blockquote><h4><a name = "tag_001_014_620">&nbsp;</a>APPLICATION USAGE</h4><blockquote>
None.
</blockquote><h4><a name = "tag_001_014_621">&nbsp;</a>EXAMPLES</h4><blockquote>
None.
</blockquote><h4><a name = "tag_001_014_622">&nbsp;</a>FUTURE DIRECTIONS</h4><blockquote>
None.
</blockquote><h4><a name = "tag_001_014_623">&nbsp;</a>SEE ALSO</h4><blockquote>
<i><a href="tabs.html">tabs</a></i>,
<i><a href="unexpand.html">unexpand</a></i>.
</blockquote><hr size=2 noshade>
<center><font size=2>
UNIX &reg; is a registered Trademark of The Open Group.<br>
Copyright &copy; 1997 The Open Group
<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]

</font></center><hr size=2 noshade>
</body></html>
